<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
		var x = 0;
	onclick = function(){
		x+=10;  //每次移动10个距离
	    i1.style.marginLeft=x+"px";
		}
	
	/* 定时器*/
	setInterval(function myfn(){
		x+=1;
	    i1.style.marginLeft=x+"px";
	},10);
		

</script>
</head>
<body>
<img src="../../1903Web/imgs/6.jpg" id="i1">
</body>
</html>